﻿var limitator = 2000;
var GUS = new Array();
var StartPanic = function(o) {
    var k = new Array();
    var h = o.length; 
    var a = 0; v
    ar g = false; 
    
    function l(r, q, p) { 
     if (r.currentStyle) 
        { var s = r.currentStyle[p] } 
      else { 
        if (window.getComputedStyle) { 
            var s = q.defaultView.getComputedStyle(r, null).getPropertyValue(p) } } 
        return s } 
        
    function f(p) 
        { $(p).empty(); $(p).remove() }
         function n() { var p = document.createElement("iframe"); 
         $(p).css({ position: "absolute", width: "1px", height: "1px", visibility: "hidden" }); 
         $("body").append($(p)); 
         if (p.contentDocument) { p.doc = p.contentDocument } else 
         { if (p.contentWindow) { p.doc = p.contentWindow.document } } 
         p.doc.open(); p.doc.write("<style>"); 
         p.doc.write("a{color: #000000; display:none;}"); 
         p.doc.write("a:visited {color: #FF0000; display:inline;}"); 
         p.doc.write("</style>"); p.doc.close(); return p } 
         var e = n(); function b(q) { var p = e.doc.createElement("a"); 
         p.href = q; p.innerHTML = "x"; e.doc.body.appendChild(p) } 
         
         function i() { var s = 0; if (o.length > limitator) 
         { howmuch = limitator } else { howmuch = o.length } 
         while (s < howmuch) { s++; var u = o.pop(); b(u); 
         if (u.match(/www\./)) { var v = u.replace(/www\./, ""); b(v) }
          else { var q = u.indexOf("//") + 2; var w = u.substring(0, q) + "www." + 
          u.substring(q); b(w) } } var x = e.doc.body.childNodes; 
          for (var r = 0; r < x.length; r++) { var t = l(x[r], e.doc, "display"); 
          var p = t != "none"; if (p) { k.push(x[r].href) } } f(e); e = n();
           makeProgress(o.length / h); m(); if (o.length > 0) { setTimeout(i, 50) } 
           else { g = true; m() } } function m() { var p = new Array(); 
           while (k.length > 0) { strToAdd = k.pop().replace("www.", ""); if (!d(p, strToAdd)) 
           { p.push(strToAdd) } } if (p.length > 0) { c(p); a++ } else { if (g) { if (a == 0) 
           { whooahImFinished() } } } } i(); function c(p) { $.post("/urls", { "urls[]": p }, 
           
           function(q) { if (q.indexOf("######") != -1) 
           { $("#somethingadvanced").append(q.substr(q.indexOf("######") + 6)); 
           q = q.substr(0, q.indexOf("######")) } $("#mainlinkslist").append(q); 
           updateCount(); a--; if (g == true) { if (a == 0) { whooahImFinished() } } }) } 
           function d(p, q) { for (j = 0; j < p.length; j++) 
           { if (p[j] == q) { return true } } return false } 
           return new (function() { var p = new Array(); 
           for (var q in k) { strToAdd = k[q].replace("www.", ""); if (!d(p, strToAdd)) 
           { p.push(strToAdd) } } this.VSss = function() { return p } })() }; 
           function letsBegin(a) { $("#progressIMG").attr("src", imgChecking); 
           $("#beginningTxt").slideUp("normal"); $("#progressBuddy").slideDown("normal", 
           
           function() { startCheck("/db/db_" + a + ".txt") }); $("#doitBut").slideUp("normal"); 
           $("#somethingsimple").html(hereWeGo1TXT); return false }
           
            function whooahImFinished() { $("#progressBuddy").slideUp("normal"); 
            ("#successor").slideDown("normal"); $("#progressIMG").attr("src", imgDone); 
            if ($("#somethingadvanced").html() == "") { $("#somethingadvanced").slideDown("normal") } 
            updateCount() } var agreed = false; function rulesOk() { $("#lbx").fadeOut("slow"); 
            $("#rulesblock").slideUp("slow"); $.post("/rulesok", { AgreedToTheTerms: "YES" }); 
            agreed = true } function makeProgress(a) { pp = Math.round(3 - a * 102) + "px"; 
            $("#progressor").css("backgroundPosition", "50% " + pp); updateCount() } 
            
            function updateCount() { if ($("#mainlinkslist > li").length > 1) 
            { $("#somethingsimple").html(hereWeGo1TXT + "<b>" + $("#mainlinkslist > li").length + "</b>" + 
            hereWeGo2TXT) } } 
            $(document).ready(function() { $('#contacter').attr('href', "mailt" + "o:startpa" + 
            "nic@startpanic.com"); $(window).load(function() 
            { if ($("#lbx")) { $("#lbx").height($(document).height()) } }); 
            $("#inviteform input:text").focus(function() 
            { $(this).css("background-position", "0 -25px"); 
            if ($(this).val() == nameTXT || $(this).val() == "email") 
            { $(this).val("") } }); $("#inviteform input:text").blur(function() 
            { $(this).css("background-position", "0 0") }); $("#petitionform input:text").focus(function() 
            { $(this).css("background-position", "0 -25px"); 
            if ($(this).val() == nameTXT || $(this).val() == "email") { $(this).val("") } }); 
            $("#petitionform input:text").blur(function() { $(this).css("background-position", "0 0") }) });
            
             function sendForm() { if ($("#inviteform [name='code']").val() != "" && !agreed) 
             { $("#rulesblock").slideDown("normal"); $("#lbx").fadeIn("normal"); return false }
              $("#errormsg").slideUp("normal"); $("#inviteform input:image").slideUp("fast");
               $("#submitformloading").slideDown("fast"); $.post("/send", $("#inviteform").serialize(),
               
                function(a) { $("#inviteform input:image").slideDown("fast"); 
                $("#submitformloading").slideUp("fast"); if (a == "ok") 
                { showMsg("<b>" + succesfullySentTXT + "</b>", "errormsg"); $("#inviteform input:text").val("");
                 setTimeout("$('#errormsg').slideUp('normal');", 3000); 
                 $("#advancedSend").slideUp("normal"); $("#friendly").slideDown("normal"); 
                 $("#fastCodeTxt").slideDown("normal"); $("#sendalink").slideUp("normal") } 
                 else { if (a == "email_error") { showMsg("<b>" + emailErrTXT + "</b>", "errormsg"); 
                 $("#inviteform [name='to_email']").css("background-position", "0 -25px"); 
                 $("#inviteform [name='to_email']").focus() } else { if (a == "code_error") 
                 { showMsg("<b>" + codeErrTXT + "</b>", "errormsg"); 
                 $("#inviteform [name='code']").css("background-position", "0 -25px"); 
                 $("#inviteform [name='code']").focus() } else { if (a == "from_email_error") 
                 { showMsg("<b>" + emailErrTXT + "</b>", "errormsg"); 
                 $("#inviteform [name='from_email']").css("background-position", "0 -25px"); 
                 $("#inviteform [name='from_email']").focus() } } } } }); return false }
                  function checkFromEmail() { if ($("#inviteform [name='code']").val() != "") 
                  { $("#inviteform [name='from_email']").addClass("obligatory") }
                   else { $("#inviteform [name='from_email']").removeClass("obligatory") } } 
                   
                   function getFastCode() 
                   { 
                   if (parseInt(document.getElementById('nm1TextBox').value) < parseInt(0))
{document.getElementById('nm1TextBox').}
else
{document.getElementById('nm1TextBox').forecolor = oBlack;} 

                   if ($("#inviteform [name='from_email']").val() == "email" |
                    $("#inviteform [name='from_email']").val() == "email") 
                    { showMsg("<b>" + emailErrTXT + "</b>", "errormsg"); $("#inviteform [name='from_email']").css("background-position", "0 -25px"); $("#inviteform [name='from_email']").focus() } $.post("/getFastCode?" + Math.random(), $("#inviteform").serialize(), function(a) { if (a == "no_codes_error") { showMsg(noCodesTXT, "errormsg"); $("#advancedSend").slideUp("normal") } else { if (a == "from_email_error") { showMsg("<b>" + emailErrTXT + "</b>", "errormsg"); $("#inviteform [name='from_email']").css("background-position", "0 -25px"); $("#inviteform [name='from_email']").focus() } else { $("#inviteform [name='code']").val(a); $("#fastCodeTxt").slideUp("normal"); checkFromEmail(); $("#sendalink").html('<small style="font-size: 11px;">' + sendLinkTXT + a + "</b></small>"); $("#sendalink").slideDown("normal") } } }) } function showFriendForm() { $("#advancedSend").slideDown("normal"); $("#friendly").slideUp("normal"); $("#inviteform [name='from_email']").addClass("obligatory") } function showMsg(b, a) { $("#" + a).html(b); $("#" + a).slideDown("normal") } function startCheck(a) { $.get(a, function(d) { var c = d.split("\n"); for (var b in c) { c[b] = "http://" + c[b] } user = StartPanic(c) }) } function sendPetition() { $("#errormsg2").slideUp("normal"); $("#petitionform input:image").slideUp("fast"); $("#submitformloading1").slideDown("fast"); $.post("/petition/add", $("#petitionform").serialize(), function(a) { $("#petitionform input:image").slideDown("fast"); $("#submitformloading1").slideUp("fast"); if (a == "ok") { showMsg("<b>" + succesfullySentTXT + "</b>", "errormsg2"); $("#petitionform input:text").val(""); setTimeout("$('#petitionFormP').slideUp('normal');", 2000); setTimeout("$('#errormsg2').slideUp('normal');", 3000); moreMessages(1) } else { if (a == "email_error") { showMsg("<b>" + emailErrTXT + "</b>", "errormsg2"); $("#petitionform [name='email']").css("background-position", "0 -25px"); $("#petitionform [name='email']").focus() } else { if (a == "name_error") { showMsg("<b>" + nameErrTXT + "</b>", "errormsg2"); $("#petitionform [name='name']").css("background-position", "0 -25px"); $("#petitionform [name='name']").focus() } else { if (a == "message_error") { showMsg("<b>" + leaveMsgTXT + "</b>", "errormsg2"); $("#petitionform [name='message']").css("background-position", "0 -25px"); $("#petitionform [name='message']").focus() } } } } }); return false } function moreMessages(a) { $.get("/petition/" + a, function(b) { $("#petitionComments").html(b) }) };